<!--添加品牌-->
<div class="dialog_content">
	<form id="info_form" name="info_form" action="{:u('brand/add')}" method="post">
	<table width="100%" class="table_form">
		<tr> 
	      <th width="80">{:L('brand_name')} :</th>
	      <td><input type="text" name="name" id="J_name" class="input-text"></td>
	    </tr>
		<tr> 
	      <th width="80">{:L('remark')} :</th>
	      <td>
              <textarea name="remark" id="J_remark"></textarea></td>
	    </tr>	    
	</table>
	</form>
</div>
<script>
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	
	$("#J_name").formValidator({ onshow:lang.please_input+lang.brand_name, onfocus:lang.please_input+lang.brand_name}).inputValidator({ min:1, onerror:lang.please_input+lang.brand_name}).ajaxValidator({type:"get", url:"", data:"m=brand&g=admin&a=ajax_check_name", datatype:"html", async:'false', success:function(data){ if(data == "1"){return true;}else{return false;}}, onerror:lang.brand_name_exists, onwait:lang.connecting_please_wait});
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        if(result.status == 1){
            $.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
        } else {
            $.pinphp.tip({content:result.msg, icon:'alert'});
        }
    }
});
</script>